<?php
/**
 * Created by PhpStorm.
 * User: yangos
 * Date: 18-6-16
 * Time: 上午6:00
 */

namespace vola;


class Enqueue
{
    private static $enqueue = [
        'script' => [],
        'style'    => []
    ];
    public static function add($name, $value = '', $type = 'script') {
        self::$enqueue[$type][$name] = $value;
    }

    public static function show($name, $type = 'script') {
        if ($type == 'script') {
            echo '<script type="text/javascript" src="'. self::$enqueue[$type][$name] .'"></script>';
        } elseif ($type == 'style') {
            echo '<link rel="stylesheet" type="text/css" href="' . self::$enqueue[$type][$name] . '" />';
        }
    }

}